<?php
/**
  * 系統名稱: Lotto 系統
  * 檔案說明: 專案管理-修改
  * $Author$
  * $Id$
  *
  */
exit();
set_time_limit(0);
include("AllWeb.inc.php");

function mkSymLink($strTarget, $strLinkName){
	if(!file_exists($strLinkName)){
		symlink($strTarget, $strLinkName);
		chown ($strLinkName, "apache");
		chmod ($strLinkName, 0777);
		print "make dir: ".$strLinkName." <br />\n";
	}else{
		print  "dir is exists: ".$strLinkName." <br />\n";
	}
}

foreach($arrWeb as $strWeb){
	//if($strWeb != "luckyball.cc")continue;
	//if($strWeb != "luckyball.cc")continue;

	/*$strFile = "/home/share/www/".$strWeb."/secure/indexpage/index_1.html";
	print $strWeb." WWW";
	$arrCon = file($strFile);
	$strCon = join("", $arrCon);
	$strCon = str_replace('action="/member/login.php" ', "action=\"/member/login.php\" autocomplete=\"off\" ", $strCon);
	$fp = fopen($strFile, "w");
	fputs($fp, $strCon);
	fclose($fp);
	print " OK!";

	$strFile = "/home/share/www/".$strWeb."/secure/indexpage/index_3.html";
	print $strWeb." WWW";
	$arrCon = file($strFile);
	$strCon = join("", $arrCon);
	$strCon = str_replace('action="/member/login.php" ', "action=\"/member/login.php\" autocomplete=\"off\" ", $strCon);
	$fp = fopen($strFile, "w");
	fputs($fp, $strCon);
	fclose($fp);
	print " OK!";

	$strFile = "/home/share/www/".$strWeb."/secure/indexpage/index_admin.html";
	print $strWeb." WWW";
	$arrCon = file($strFile);
	$strCon = join("", $arrCon);
	$strCon = str_replace('action="login_admin.php" ', "action=\"login_admin.php\" autocomplete=\"off\" ", $strCon);
	$fp = fopen($strFile, "w");
	fputs($fp, $strCon);
	fclose($fp);
	print " OK!";*/

	/*$strFile = "/home/share/www/".$strWeb."/secure/error.php";
	print $strWeb." WWW";
	$arrCon = file($strFile);
	$strCon = join("", $arrCon);
	$strCon = str_replace('exit();', '@mysql_close($$_Conn);'."\n".'exit();', $strCon);
	$fp = fopen($strFile, "w");
	fputs($fp, $strCon);
	fclose($fp);
	print " OK!";*/

	/*$strFile = "/home/share/www/".$strWeb."/secure/db.inc.php";
	print $strWeb." WWW";
	$arrCon = file($strFile);
	$strCon = join("", $arrCon);
	$strCon = str_replace('mail(', '//mail(', $strCon);
	$fp = fopen($strFile, "w");
	fputs($fp, $strCon);
	fclose($fp);
	print " OK!";*/

	print $strWeb." WWW";
	$strFile = "/home/share/www/".$strWeb."/secure/indexpage/top_member.html";
	if (file_exists($strFile)){
		$arrCon = file($strFile);
		$strCon = implode("", $arrCon);
		$strCon = preg_replace("/<marquee .+marquee>/s", '<marquee scrolldelay="180" id="Marquees" onclick="getNewsPage()" onmouseover="this.stop()" onmouseout="this.start()" style="cursor:pointer">Welcome~~~</marquee>', $strCon);

		$strCon = preg_replace("/<form .+form>/s", '<form action="../membertemplate/account.html?sid={sid}" target="leftFrame" name="LeftForm"></form>'."\n".'<form action="../membertemplate/mem_msg.html?sid={sid}" target="mainFrame" name="MainForm"></form>', $strCon);

		$strCon = preg_replace("/function ReRefresh.+script>/s", '//-->'."\n".'</script>', $strCon);

		$fp = fopen($strFile, "w");
		fputs($fp, $strCon);
		fclose($fp);
		print " lotto OK!\n";
	}

	$strFile = "/home/share/www/".$strWeb."/secure/indexpage/top_member3d.html";
	if (file_exists($strFile)){
		$arrCon = file($strFile);
		$strCon = implode("", $arrCon);
		$strCon = preg_replace("/<marquee .+marquee>/s", '<marquee scrolldelay="180" id="Marquees" onclick="getNewsPage()" onmouseover="this.stop()" onmouseout="this.start()" style="cursor:pointer">Welcome~~~</marquee>', $strCon);

		$strCon = preg_replace("/<form .+form>/s", '<form action="../membertemplate/account.html?sid={sid}" target="leftFrame" name="LeftForm"></form>'."\n".'<form action="../membertemplate/mem_msg.html?sid={sid}" target="mainFrame" name="MainForm"></form>', $strCon);

		$strCon = preg_replace("/function ReRefresh.+script>/s", '//-->'."\n".'</script>', $strCon);

		$fp = fopen($strFile, "w");
		fputs($fp, $strCon);
		fclose($fp);
		print " 3d OK!\n";
	}

	$strFile = "/home/share/www/".$strWeb."/secure/indexpage/top_member7s.html";
	if (file_exists($strFile)){
		$arrCon = file($strFile);
		$strCon = implode("", $arrCon);
		$strCon = preg_replace("/<marquee .+marquee>/s", '<marquee scrolldelay="180" id="Marquees" onclick="getNewsPage()" onmouseover="this.stop()" onmouseout="this.start()" style="cursor:pointer">Welcome~~~</marquee>', $strCon);

		$strCon = preg_replace("/<form .+form>/s", '<form action="../membertemplate/account.html?sid={sid}" target="leftFrame" name="LeftForm"></form>'."\n".'<form action="../membertemplate/mem_msg.html?sid={sid}" target="mainFrame" name="MainForm"></form>', $strCon);

		$strCon = preg_replace("/function ReRefresh.+script>/s", '//-->'."\n".'</script>', $strCon);

		$fp = fopen($strFile, "w");
		fputs($fp, $strCon);
		fclose($fp);
		print " 7s OK!\n";
	}
} //foreach($arrWeb as $strWeb)//
?>